package com.alcj.service.impl;

import com.alcj.common.constant.SysConstant;
import com.alcj.mapper.ContactUsMapper;
import com.alcj.mapper.FirmCultureMapper;
import com.alcj.mapper.NewsMapper;
import com.alcj.model.ContactUs;
import com.alcj.model.FirmCulture;
import com.alcj.model.News;
import com.alcj.service.CompanyAboutService;
import com.alcj.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author :chenxh
 * @version :v1.0
 * @Package :com.alcj.service.impl
 * @Description :${TODO}(新闻资讯数据处理)
 * @date :2017/9/5 11:23
 */
@Service
public class NewsServiceImpl implements NewsService {

    @Autowired
    NewsMapper newsMapper;

    /**
     * @Author: chenxh
     * @Description:查询获取首页显示新闻资讯
     * @Date: 2017/9/7 16:29
     * @param: record
     */
    @Override
    public List<News> getNewsInfo(String newsType) throws Exception{

        // 返回结果
        return this.newsMapper.selectNewsList(newsType);
    }

    /**
     * @Author: chenxh
     * @Description:查询获取首页显示新闻资讯
     * @Date: 2017/9/7 16:29
     * @param: record
     */
    @Override
    public News getDetailInfo(int newsId) throws Exception{

        // 返回结果
        return this.newsMapper.selectByPrimaryKey(newsId);
    }

    /**
     * @Author: chenxh
     * @Description:分页查询获取新闻资讯
     * @Date: 2017/9/7 16:29
     * @param: record
     */
    @Override
    public int getPageNewsCount(News record) throws Exception{
        // 返回结果
        return this.newsMapper.selectPageNewsListCount(record);
    }

    /**
     * @Author: chenxh
     * @Description:分页查询获取新闻资讯
     * @Date: 2017/9/7 16:29
     * @param: record
     */
    @Override
    public List<News> getPageNewsInfo(News record) throws Exception{
        // 返回结果
        return this.newsMapper.selectPageNewsList(record);
    }
}
